import pymysql

# 封装的连接维度科技的数据库类
class DB():
    def __init__(self, host, user, password, database):
        self.con = pymysql.connect(host=host, user=user, password=password, database=database)
        self.cur = self.con.cursor()

    def seatch(self, sql):
        self.cur.execute(sql)
        return self.cur.fetchall()

    def close(self):
        self.cur.close()
        self.con.close()



